<?php /* @var $myanswers sfPropelPager */;?>
<?php /* @var $answer StatementAnswer */;?>
<div class="tabbed">
	<ul class="tabs">
		<li id="tab-otherprofile_statements" class="tab<?php echo $active_tab == 'statements' ? ' active' : ''?>">Statements</li>
		<li id="tab-otherprofile_debates" class="tab<?php echo $active_tab == 'debates' ? ' active' : ''?>">Debates</li>
	</ul>

	<div id="otherprofile_statements" class="content<?php echo $active_tab == 'debates' ? ' hide' : ''?>">
		<ul>
		<?php foreach($statement_answers->getResults() as $answer): ?>
			<li class="debate debate-<?php echo $answer->getLypoStatement()->getId()?>">
				"<?php echo $answer->getLypoStatement()->getText()?>"
				<?php if ($answer->getAnswer() == 'a'): ?>
				<span class="vote-yes-active">I agree</span>
				<?php elseif ($answer->getAnswer() == 'c'): ?>
				<span class="vote-no-active">I disagree</span>
				<?php endif;?>
			</li>
		<?php endforeach; ?>
		</ul>
		
		<?php if($statement_answers->haveToPaginate()): ?>
		<p class="group" style="margin-bottom: 0;">
			<?php if($statement_answers->getPreviousPage() < $statement_answers->getPage()): ?>
				<?php echo link_to('previous five','otherprofile/statements?active=statements&profile_userid='.$profile_userid.'&userid='.$userid.'&statement_page='.$statement_answers->getPreviousPage(),'class=prevlink'); ?>
			<?php endif; ?>
			<?php if($statement_answers->getNextPage() > $statement_answers->getPage()): ?>
				<?php echo link_to('next five','otherprofile/statements?active=statements&profile_userid='.$profile_userid.'&userid='.$userid.'&statement_page='.$statement_answers->getNextPage(),'class=nextlink'); ?>
			<?php endif; ?>
		</p>
		<?php endif; ?>
		
	</div>
	
	
	<div id="otherprofile_debates" class="content<?php echo $active_tab == 'statements' ? ' hide' : ''?>">
		<?php if($mydebatereactions && count($mydebatereactions)): ?>
			<ul>
			<?php foreach($mydebatereactions->getResults() as $reaction): ?>
				<li class="group">
					<span class="statement debate debate-<?php echo $reaction->getLypoStatement()->getId()?>"><?php echo $reaction->getLypoStatement()->getText()?></span>
					
					<?php if ($myanswers[$reaction->getStatementId()] == 'a'):?>
					<span class="vote-yes-active">I agree</span>
					<?php elseif ($myanswers[$reaction->getStatementId()] == 'c'):?>
					<span class="vote-yes-active">I disagree</span>
					<?php endif; ?>

					<span class="debate debate-<?php echo $reaction->getLypoStatement()->getId()?>">Go to debate</span>
				</li>
			<?php endforeach; ?>
			</ul>
			
			<?php if($mydebatereactions->haveToPaginate()): ?>
			<p class="group" style="margin-bottom: 0;">
				<?php if($mydebatereactions->getPreviousPage() < $mydebatereactions->getPage()): ?>
					<?php echo link_to('previous five','otherprofile/statements?active=debates&profile_userid='.$profile_userid.'&userid='.$userid.'&debate_page='.$mydebatereactions->getPreviousPage(),'class=prevlink'); ?>
				<?php endif; ?>
				<?php if($mydebatereactions->getNextPage() > $mydebatereactions->getPage()): ?>
					<?php echo link_to('next five','otherprofile/statements?active=debates&profile_userid='.$profile_userid.'&userid='.$userid.'&debate_page='.$mydebatereactions->getNextPage(),'class=nextlink'); ?>
				<?php endif; ?>
			</p>
			<?php endif; ?>
		<?php else: ?>
			<p>This user has not commented on any debates yet.</p> 
		<?php endif; ?>
	</div>
	
	
</div>